﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyVideoPlayer.Converters
{
    public class VolumeConverter : ValueConverterBase
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is int volume)
            {
                return volume switch
                {
                    > 70 => "3",
                    > 30 => "2",
                    > 0 => "1",
                    _ => "0"
                };
            }
            return "0";
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
